<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue应用</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="Application">
        <button @click="click">单击</button>
    </div>
    <script>
        const appData = {
            data:{
                count:0
            }
        }
        const App = Vue.createApp({
            data(){
                return appData
            },
            computed: {
                countString: {
                    get(){
                        return this.count + "次"
                    }
                }
            },
            methods:{
                click(){
                    this.data.count += 1
                }
            },
            watch:{
                data:{
                    handler(value, oldValue) {
                        console.log(value, oldValue)
                    },
                    deep:true
                }
            }
        })
        App.mount("#Application") 
    </script>
</body>
</html>